<script lang="ts" setup>

import { computed,ref,onMounted } from 'vue';
import { useRoute } from 'vue-router';

import { Page } from '@vben/common-ui';
import { useTabs } from '@vben/hooks';

import { useTitle } from '@vueuse/core';
import {
  Card,
  Descriptions,
  DescriptionsItem,
} from 'ant-design-vue';
import { storeToRefs } from 'pinia';

import { useVbenForm } from '#/adapter/form';
import { getEmailLogInfo } from '#/api/admin/emailLog';

const route = useRoute();
const id = Number(route.params.id);

const detail = ref({
  id: '',
  subject: '',
  content: '',
  to:'',
  from:'',
});

const fetchDetail = async () => {
  const res = await getEmailLogInfo(id); // 你需要自己实现这个 API
  detail.value = res.data;
};

onMounted(fetchDetail);
</script>
<template>
  <Page auto-content-height>
    <Card :table-title="`${viewTitle}详情`">
      
           <Descriptions title="模板信息" bordered :column="4" :label-style="{ width: '120px' }">
                <DescriptionsItem label="to" :span="4">{{detail.to}}</DescriptionsItem>
                <DescriptionsItem label="from" :span="4">{{detail.from}}</DescriptionsItem>
                <DescriptionsItem label="subject" :span="4">{{detail.subject}}</DescriptionsItem>
                <DescriptionsItem label="content" :span="4">
                  <div v-html="detail.content"></div>
                </DescriptionsItem>

            </Descriptions>
         
            
    </Card>
  </Page>
</template>
